package com.xmtlxx.wms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.wms.domain.Viewing;
import com.xmtlxx.wms.domain.bo.ViewingBo;
import com.xmtlxx.wms.domain.vo.ViewingVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 看样记录Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface ViewingMapper extends BaseMapperPlus<ViewingMapper, Viewing, ViewingVo> {
    /**
     * 根据条件分页查询看样记录
     *
     * @param viewing 看样记录
     * @return Page Viewing
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "v.create_by"),
        @DataColumn(key = "deptName", value = "v.dept_id"),
        @DataColumn(key = "userName", value = "v.create_by")
    })
    Page<ViewingVo> selectPageViewingList(@Param("page") Page<Viewing> page,@Param("viewing") ViewingBo viewing);

    /**
     * 查询看样记录列表
     *
     * @param viewing 看样记录
     * @return 看样记录集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "v.create_by"),
        @DataColumn(key = "deptName", value = "v.dept_id"),
        @DataColumn(key = "userName", value = "v.create_by")
    })
    List<ViewingVo> selectViewingList(@Param("viewing") ViewingBo viewing);

    ViewingVo selectViewingVoByID(String id);
}
